package com.szrt.java.day20161230.demo04;


/**
 * Student04 子类
 * Person04  父类
 * 
 * extends 关键字 表示继承
 * 
 * 子类会继承父类public的方法 5
 * 自己有2个方法
 * 一共  = 5+2
 * 
 * @author zsrt
 *
 */
public class Student04 extends Person04{
	
	
	private String school;

	public String getSchool() {
		return school;
	}

	public Student04(){
		System.out.println("调用了子类Student04的构造方法...");
	}
	public void setSchool(String school) {
		this.school = school;
	}
	
	
	public void accessFatherAttribute(){
		
		String xx  =super.jiapu;
		System.out.println("子类访问父类的属性jaipu="+xx);
		System.out.println(super.getAge());
	}

	@Override
	public String toString() {
		//super
		return "Student04 [school=" + school + ",name="+super.getName()+",age="+super.getAge()+"]";
	}
	
	
	
	

}
